import QtQuick 2.2

/*
* 动画
*/

Rectangle {
	width: 320;
	height: 240;
	color: "#EEEEEE";
	id: rootItem;

	Rectangle {
		id: rect;
		width: 50;
		height: 150;
		anchors.centerIn: parent;
		color: "blue";

		PropertyAnimation {
			id: animation;
			//target: rect;
			targets: [rect,rect2];
			//property: "width";  改变单个属性
			properties: "width,height"; //改变多个属性
			to: 220;
			duration: 1000;
		}

		MouseArea {
			anchors.fill: parent;
			onClicked: animation.running = true;
		}
	}

	Rectangle {
		id: rect2;
		width: 50;
		height: 150;
		anchors.left: parent.left;
		anchors.leftMargin: 4;
		color: "red";
	}
}
